<template>
  <div>
    <h3>孩子组件</h3>
    <p>我的玩具：{{ myToy }}</p>
    <p>我的父母给我的玩具：{{ myParentsGivenToy }}</p>
    <button v-on:click="sendToy(myToy)">点击我给父组件传递我的玩具</button>
  </div>
</template>
<script lang="ts" setup>
const myToy = "小飞机"

// defineProps(["myParentsGivenToy", "sendToy"])

defineProps(
  {
    myParentsGivenToy: {
      type: String,
      required: true
    },
    sendToy: {
      type: Function,
      required: true,

    }
  }
)



</script>
<style lang="scss" scoped></style>
